package restful.struts2;

import java.io.*;

public class Slurp {

	public static final String slurp(Reader in) {
		try {
			StringBuilder stringBuilder = new StringBuilder();
			char[] buffer = new char[1024];
			int len = 0;
			while ((len = in.read(buffer)) > 0) {
				stringBuilder.append(buffer, 0, len);
			}
			return stringBuilder.toString();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
